from flask import Blueprint

from .reimbursement_controller import ReimbursementController
from .schedule_controller import ScheduleController
from .travel_controller import TravelController

reimbursement_blueprint = Blueprint('reimbursement', __name__)

reimbursement_controller = ReimbursementController()

# 路由映射
reimbursement_blueprint.add_url_rule(
    '/getReimbursementById', view_func=reimbursement_controller.get_reimbursement_by_id, methods=['POST'])
reimbursement_blueprint.add_url_rule(
    '/getReimbursementsByIdList', view_func=reimbursement_controller.get_reimbursements_by_id_list,
    methods=['POST'])
reimbursement_blueprint.add_url_rule(
    '/addReimbursement', view_func=reimbursement_controller.add_reimbursement,
    methods=['POST'])
reimbursement_blueprint.add_url_rule(
    '/getReimbursementByTravelId', view_func=reimbursement_controller.get_reimbursement_by_travel_id,
    methods=['POST'])
schedule_blueprint = Blueprint('schedule', __name__)

schedule_controller = ScheduleController()
# 路由映射
schedule_blueprint.add_url_rule(
    '/getScheduleById', view_func=schedule_controller.get_schedule_by_id, methods=['POST'])
schedule_blueprint.add_url_rule(
    '/add', view_func=schedule_controller.add_schedule, methods=['POST'])
schedule_blueprint.add_url_rule(
    '/getAllScheduleListByTravelId', view_func=schedule_controller.get_schedule_by_travel_id, methods=['POST'])


travel_blueprint = Blueprint('travel', __name__)

travel_controller = TravelController()
# 路由映射
travel_blueprint.add_url_rule(
    '/getTravelById', view_func=travel_controller.get_travel_by_id, methods=['POST'])
travel_blueprint.add_url_rule(
    '/getAllTravelsByIdList', view_func=travel_controller.get_all_travels_by_id_list, methods=['POST'])
travel_blueprint.add_url_rule(
    '/getFinalTravelListByUserId', view_func=travel_controller.get_final_travel_list_by_user_id, methods=['POST'])
travel_blueprint.add_url_rule(
    '/add', view_func=travel_controller.add_travel, methods=['POST'])
travel_blueprint.add_url_rule(
    '/getAllTravelListByUserId', view_func=travel_controller.get_travel_by_user_id, methods=['POST'])